package org.example.projecttwo.controller.system;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.example.projecttwo.common.Result;
import org.example.projecttwo.entity.College;
import org.example.projecttwo.service.ICollegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/college")
@Tag(name = "学院管理", description = "学院信息管理")

public class CollegeController {
    @Autowired
    private ICollegeService collegeService;

    @GetMapping("/list")
    @Operation(summary = "获取学院列表", description = "获取所有学院列表 -- 学院管理")
    public Result<List<College>> listColleges(){
        return Result.success(collegeService.list());
    }

}